<template>
  <div>
    111
    <br />
    <van-button type="danger" @touchstart="btn">1231231</van-button>
    <br />
    <van-cell title="选择单个日期" :value="date" @click="show = true" />
    <van-calendar v-model="show" @confirm="onConfirm" />
  </div>
</template>

<script>
// 按需手动引入
/* import vanButton from "vant/lib/button";
import "vant/lib/button/style"; */
import { Toast } from "vant";
export default {
  /*  components: {
    [Button.name]: vanButton,
  }, */
  data() {
    return {
      date: "",
      show: false,
    };
  },
  methods: {
    formatDate(date) {
      return `${date.getMonth() + 1}/${date.getDate()}`;
    },
    onConfirm(date) {
      this.show = false;
      this.date = this.formatDate(date);
    },
    btn() {
      Toast.loading({
        message: "加载中...",
        forbidClick: true,
      });
    },
  },
};
</script>

<style>
</style>